ARG OS_BASE=registry.openanolis.cn/openanolis/anolisos:23

FROM ${OS_BASE} as plugin_builder
RUN dnf install intel-QAT20 -y
RUN dnf install accel-telemetry -y
RUN dnf install intel-accel-plugin-qat -y


FROM registry.openanolis.cn/openanolis/anolisos:23-busybox

COPY --from=plugin_builder /usr/sbin/adf_ctl /usr/sbin
COPY --from=plugin_builder /usr/bin/qat_plugin /usr/bin
COPY --from=plugin_builder /usr/bin/accel-telemetry /usr/bin
COPY --from=plugin_builder /lib64/libgcc_s-12-20221121.so.1 /lib64/
COPY --from=plugin_builder /lib64/libgcc_s.so.1 /lib64
COPY --from=plugin_builder /lib64/libpthread.so.0 /lib64
COPY --from=plugin_builder /lib64/libm.so.6 /lib64
COPY --from=plugin_builder /lib64/libdl.so.2 /lib64
COPY --from=plugin_builder /lib64/libc.so.6 /lib64
COPY --from=plugin_builder /lib64/libstdc++.so.6 /lib64

COPY entrypoint.sh /

LABEL \
    maintainer="OpenAnolis Intel Arch SIG" \
    org.opencontainers.image.title="Intel accelerator plugin of Intel QAT for Kubernetes" \
    org.opencontainers.image.version="0.27-23"

ENTRYPOINT ["/entrypoint.sh"]
